﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AppData{
	public static string Key_LoginTimes = "LoginTimes";
	public static string Key_Phone		= "PhoneNumber";
	public static string Key_Password	= "Password";

	public bool IsFirstLogin
	{
		get { return LoginTimes == 0; }
	}


	public int LoginTimes
	{
		get
		{
			if (PlayerPrefs.HasKey(Key_LoginTimes))
				return PlayerPrefs.GetInt(Key_LoginTimes);
			else
				return 0;
		}
		set
		{
			PlayerPrefs.SetInt(Key_LoginTimes, value);
		}
	}

	public string PhoneNumber
	{
		get
		{
			if (PlayerPrefs.HasKey(Key_Phone))
				return PlayerPrefs.GetString(Key_Phone);
			else
				return string.Empty;
		}
		set
		{
			PlayerPrefs.SetString(Key_Phone, value);
		}
	}

	public string Password
	{
		get
		{
			if (PlayerPrefs.HasKey(Key_Password))
				return PlayerPrefs.GetString(Key_Password);
			else
				return string.Empty;
		}
		set
		{
			PlayerPrefs.SetString(Key_Password, value);
		}
	}
}

